home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / internet / amitcp3.0b / netinclude / clib / socket_inlines.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-21  |  1.3 KB  |  53 lines

  1. #ifndef CLIB_SOCKET_INLINES_H
  2. #define CLIB_SOCKET_INLINES_H
  3. /*
  4. **      $Filename: clib/socket_inline.h $
  5. **    $Release$
  6. **      $Revision: 3.2 $
  7. **      $Date: 1994/02/14 06:01:21 $
  8. **
  9. **    Some inlines to replace common stubs 
  10. **
  11. **    Copyright © 1993 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  12. **                  Helsinki University of Technology, Finland.
  13. **                  All rights reserved.
  14. */
  15.  
  16. #define select        _static_inline_select
  17. #define inet_ntoa     _static_inline_inet_ntoa
  18. #define inet_makeaddr _static_inline_inet_makeaddr
  19. #define inet_lnaof    _static_inline_inet_lnaof
  20. #define inet_netof    _static_inline_inet_netof
  21.  
  22. static int __inline 
  23. select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exeptfds,
  24.      struct timeval *timeout)
  25. {
  26.   /* call WaitSelect with NULL signal mask pointer */
  27.   return WaitSelect(nfds, readfds, writefds, exeptfds, timeout, NULL);
  28. }
  29.  
  30. static char * __inline
  31. inet_ntoa(struct in_addr addr) 
  32. {
  33.   return Inet_NtoA(addr.s_addr);
  34. }
  35. static struct in_addr __inline
  36. inet_makeaddr(int net, int host)
  37. {
  38.   struct in_addr addr;
  39.   addr.s_addr = Inet_MakeAddr(net, host);
  40.   return addr;
  41. }
  42. static unsigned long __inline
  43. inet_lnaof(struct in_addr addr) 
  44. {
  45.   return Inet_LnaOf(addr.s_addr);
  46. }
  47. static unsigned long  __inline
  48. inet_netof(struct in_addr addr)
  49. {
  50.   return Inet_NetOf(addr.s_addr);
  51. }
  52. #endif /* CLIB_SOCKET_INLINES_H */
  53.